package com.wenson.behavior.command;

import java.util.Arrays;

/**
 * @ClassName: TVClient
 * @Author: luowangcheng
 * @Date: 2024/6/16 13:11
 * @Description:
 */
public class TVAndBulbClient {
    public static void main(String[] args) {
        Keyboard keyboard = new Keyboard();
        TV tv = new TV();
        Bulb bulb = new Bulb();
        Command tvOnCommand = new TVOnCommand(tv);
        Command tvChannelUpCommand = new TVChannelUpCommand(tv);
        Command bulbOnCommand = new BulbOnCommand(bulb);

        keyboard.bindKeyCommand(
                Keyboard.KeyCode.F1,
                Arrays.asList(
                        bulbOnCommand,
                        tvOnCommand,
                        tvChannelUpCommand,
                        tvChannelUpCommand,
                        tvChannelUpCommand
                )
        );

        keyboard.onKeyPressed(Keyboard.KeyCode.F1);
    }
}
